package com.cn.xiaonuo.tcrfinance.tcrtimes.controller;

import com.cn.xiaonuo.common.entity.BusinessMessage;
import com.cn.xiaonuo.common.utils.ApiJsonModel;
import com.cn.xiaonuo.tcrfinance.tcrtimes.service.HtTimeService;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


/**
 * 交易日期，交易时间
 */
@RestController
public class AppHtTimeController {

    @Autowired
    private HtTimeService htTimeService;

    /**
     * showdoc
     * @param pageSize 选填 String   页码
     * @param pageNo 选填 String   每页多少数量
     * @return {"success": true,"code": "200","msg": "操作成功"}
     * @catalog JAVA接口文档/和平村/交易时间设置
     * @title 1.查询非工作日列表
     * @description 查询非工作日列表
     * @method post
     * @url /api/v1/timeconfig/selectHolidays
     * @return_param id  String  id
     * @return_param holiday  String  非工作日期
     * @return_param create_time  String  创建时间
     * @return_param update_time  String  更新时间
     * @return_param msg String 提示信息
     * @return_param success Boolean 返回状态
     * @remark 接口由bysujc编写
     * @number 10
     */
    @ApiOperation(value = "非工作时间列表-列表页面", notes = "非工作时间列表-列表页面")
    @ApiJsonModel({@ApiModelProperty(name = "pageSize", value = "页码", example = "页码"), @ApiModelProperty(name = "pageNo", value = "每页多少数量", example = "每页多少数量")})
    @RequestMapping(value = "/api/hpctime/selectHolidays", method = RequestMethod.POST)
    public BusinessMessage selectHolidays(@RequestBody Map<String, Object> params) {
        BusinessMessage message = htTimeService.selectHolidays(params);
        return message;
    }

    /**
     * showdoc
     *
     * @param holiday 必填 String   非工作日
     * @return {"success": true,"code": "200","msg": "操作成功"}
     * @catalog JAVA接口文档/和平村/交易时间设置
     * @title 2.添加工作日
     * @description 添加工作日
     * @method post
     * @return_param msg String 提示信息
     * @return_param success Boolean 返回状态
     * @remark 接口由bysujc编写
     * @number 20
     */
    @ApiOperation(value = "非工作时间列表-新增非工作日期", notes = "非工作时间列表-新增非工作日期")
    @ApiJsonModel({@ApiModelProperty(name = "holiday", value = "非工作日", example = "非工作日", required = true),})
    @RequestMapping(value = "/api/hpctime/insertHoliday", method = RequestMethod.POST)
    public BusinessMessage insertHoliday(@RequestBody Map<String, Object> params) {
        BusinessMessage message = htTimeService.insertHoliday(params);
        return message;
    }

    /**
     * showdoc
     *
     * @param id 必填 String   ID
     * @return {"success": true,"code": "200","msg": "操作成功"}
     * @catalog JAVA接口文档/和平村/交易时间设置
     * @title 3.删除工作日
     * @description 删除工作日
     * @method post
     * @url /api/v1/timeconfig/deleteHoliday
     * @return_param msg String 提示信息
     * @return_param success Boolean 返回状态
     * @remark 接口由bysujc编写
     * @number 30
     */
    @ApiOperation(value = "非工作时间列表-删除", notes = "非工作时间列表-删除")
    @ApiJsonModel({@ApiModelProperty(name = "id", value = "id", example = "id（true）", required = true)})
    @RequestMapping(value = "/api/hpctime/deleteHoliday", method = RequestMethod.POST)
    public BusinessMessage deleteHoliday(@RequestBody Map<String, Object> params) {
        BusinessMessage message = htTimeService.deleteHoliday(params);
        return message;
    }

    /**
     * showdoc
     *
     * @return {"success": true,"code": "200","msg": "操作成功"}
     * @catalog JAVA接口文档/和平村/交易时间设置
     * @title 4.查询交易时间
     * @description 查询交易时间
     * @method post
     * @return_param id Integer  ID
     * @return_param start_time String  交易开始时间
     * @return_param end_time String    交易结束时间
     * @return_param create_time String  创建时间
     * @return_param update_time String  更新时间
     * @return_param remark String  备注
     * @return_param msg String 提示信息
     * @return_param success Boolean 返回状态
     * @remark 接口由bysujc编写
     * @number 40
     */
    @ApiOperation(value = "商品交易时间-列表页面", notes = "商品交易时间-列表页面")
    @ApiJsonModel({@ApiModelProperty(name = "pageSize", value = "页码", example = "页码"), @ApiModelProperty(name = "pageNo", value = "每页多少数量", example = "每页多少数量")})
    @RequestMapping(value = "/api/hpctime/selectTradeTimes", method = RequestMethod.POST)
    public BusinessMessage selectTradeTimes(@RequestBody Map<String, Object> params) {
        BusinessMessage message = htTimeService.selectTradeTimes(params);
        return message;
    }

    /**
     * showdoc
     *
     * @param startTime 必填 String 交易开始时间
     * @param endTime   必填 String 交易结束时间
     * @param remark    选填 String 备注
     * @return {"success": true,"code": "200","msg": "操作成功"}
     * @catalog JAVA接口文档/和平村/交易时间设置
     * @title 5.添加交易时间
     * @description 添加交易时间
     * @method post
     * @return_param msg String 提示信息
     * @return_param success Boolean 返回状态
     * @remark 接口由bysujc编写
     * @number 50
     */

    @ApiOperation(value = "商品交易时间-商品交易时间新增", notes = "商品交易时间-商品交易时间新增")
    @ApiJsonModel({@ApiModelProperty(name = "startTime", value = "startTime", example = "开始时间", required = true), @ApiModelProperty(name = "endTime", value = "endTime", example = "结束时间", required = true), @ApiModelProperty(name = "remark", value = "remark", example = "备注说明", required = true),})
    @RequestMapping(value = "/api/hpctime/insertTradeTime", method = RequestMethod.POST)
    public BusinessMessage insertTradeTime(@RequestBody Map<String, Object> params) {
        BusinessMessage message = htTimeService.insertTradeTime(params);
        return message;
    }

    /**
     * showdoc
     *
     * @param id 必填 String id
     * @return {"success": true,"code": "200","msg": "操作成功"}
     * @catalog JAVA接口文档/和平村/交易时间设置
     * @title 6.删除交易时间
     * @description 删除交易时间
     * @method post
     * @url /api/v1/timeconfig/deleteTradeTime
     * @return_param msg String 提示信息
     * @return_param success Boolean 返回状态
     * @remark 接口由bysujc编写
     * @number 60
     */
    @ApiOperation(value = "商品交易时间-删除", notes = "商品交易时间-删除")
    @ApiJsonModel({@ApiModelProperty(name = "id", value = "id", example = "id（true）", required = true)})
    @RequestMapping(value = "/api/hpctime/deleteTradeTime", method = RequestMethod.POST)
    public BusinessMessage deleteTradeTime(@RequestBody Map<String, Object> params) {
        BusinessMessage message = htTimeService.deleteTradeTime(params);
        return message;
    }
}
